<?php

 require_once("../include/httpclient.php");
 require_once("../include/db_mysql.php");
// serviceurl：1002 导购站内搜索
function daogou_search($arg)
{
//返回第几页的数据，一页20户商家
 $page = $arg['page'];
 $data = array('input' =>urlencode(stripslashes($arg['input'])));
 //查询daogou系统，
 $productArrayJson = call_serviceurl(1003,$data);
 $productArray = (array)json_decode($productArrayJson,true);
 $totalPageNum = ceil(count($productArray)/30);
 $resultByPage = array_splice($productArray,($page-1)*30,30);
 $return = array($resultByPage,$totalPageNum);  
 return json_encode($return);
}
?>